package cc.rengu.igas.share.facade.bean.cups;

import java.util.Arrays;

/**
 * F48 AS UP  附加信息标识
 *
 * @author fangminwei
 * @date 2021/4/17
 */
@SuppressWarnings("AlibabaEnumConstantsMustHaveComment")
public enum F48_AS_UP_AddInfoEnum {
    _0001("0001", "商户白名单标识"),
    ;

    private String code;
    private String desc;

    F48_AS_UP_AddInfoEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    @Override
    public String toString() {
        return code + "-" + desc;
    }

    public static F48_AS_UP_AddInfoEnum find(String code) {
        F48_AS_UP_AddInfoEnum result = Arrays.asList(F48_AS_UP_AddInfoEnum.values()).stream()
                .filter(e -> e.getCode().equals(code)).findFirst().orElse(null);

        //  0002~9999 保留使用
//        if (result == null)
//            throw new BizException(OltpRpcdEnum.PARAM_IS_EMPTY_OR_NULL.getRespCode(), "找不到对应的枚举信息" + code);

        return result;
    }
}
